package cn.tsmchina.one.service.user;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.tsmchina.one.dao.user.CustomerDao;
import cn.tsmchina.one.domain.user.Customer;

@Service
public class CustomerServiceImpl implements CustomerService {
	@Autowired
	private CustomerDao customerDao;
	public void setCustomerDao(CustomerDao customerDao) {
		this.customerDao = customerDao;
	}
	public CustomerDao getCustomerDao() {
		return customerDao;
	}
	
	public void addCustomer(Customer customer) {
		customerDao.addCustomer(customer);
	}
	
	public void updateCustomer(Customer customer) {
		customerDao.updateCustomer(customer);
	}
	
	public Customer getCustomerByLoginId(Integer loginId) {
		return customerDao.getCustomerByLoginId(loginId);
	}
	
	public List<Customer> getAllCustomers() {
		return customerDao.getAllCustomers();
	}
	@Override
	public Customer getCustomer(String userName, String password)
	{
		return customerDao.getCustomers(userName,password);
	}
	@Override
	public void deleteCustomer(long customerId) {
		customerDao.deleteCustomer(customerId);
	}
	@Override
	public Customer getCustomerById(long id) {
		return customerDao.getCustomerById(id);
	}

	
}
